package com.gateway.order.controller;

import com.gateway.order.feign.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrderController {
    @Value("${server.port}")
    String port;

    @Autowired
    IUserService userService;

    /**
     * 获取用户服务的端口
     * @return
     */
    @GetMapping("/getOrderPort")
    public String getUserPort() {
        return "order-service port：" + port;
    }

    /**
     * 获取订单服务的端口
     * @return
     */
    @GetMapping("/getUserPort")
    public String getOrderPort() {
        return "order: user-service port：" + userService.getPort();
    }
}
